cmake_minimum_required(VERSION 3.10)
project(vulkan-render)

SET(CMAKE_CXX_STANDARD 17)
SET(CMAKE_BUILD_TYPE Release)

# set include and lib dirs
IF (WIN32)
    # setup for windows
    SET(GLFW3_INCLUDE_DIR "D:/Libs/glfw/include/")
    SET(GLFW3_LIBRARY "D:/Libs/glfw/lib/glfw3.lib")
    
    SET(STBIMAGE_INCLUDE_DIR "D:/Libs/stb_image/include")
    SET(TINYOBJLOADER_INCLUDE_DIR "D:/Libs/tinyobjloader/include")

    SET(GLM_INCLUDE_DIR "D:/Libs/glm/include")

    SET(VK_INCLUDE_DIR "C:/VulkanSDK/1.2.198.1/Include")
    SET(VK_LIBRARY "C:/VulkanSDK/1.2.198.1/Lib/vulkan-1.lib")

    SET(SOURCE_INCLUDE_DIR "${PROJECT_SOURCE_DIR}/src")
    
    ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS)
    ADD_DEFINITIONS(-D_CRT_SECURE_NO_DEPRECATIONS)
ELSE ()
    # Linux

ENDIF (WIN32)

FILE(GLOB_RECURSE SOURCE_CPP_FILES 
    "${PROJECT_SOURCE_DIR}/src/*.c"
    "${PROJECT_SOURCE_DIR}/src/*.cpp")
FILE(GLOB_RECURSE HEADER_FILES 
    "${PROJECT_SOURCE_DIR}/src/*.h"
    "${PROJECT_SOURCE_DIR}/src/*.hpp")

ADD_EXECUTABLE(
    vk_render
    ${SOURCE_CPP_FILES} 
    ${HEADER_FILES}
)

TARGET_INCLUDE_DIRECTORIES(
    vk_render PRIVATE
    ${VK_INCLUDE_DIR}
    ${SOURCE_INCLUDE_DIR}
    ${GLFW3_INCLUDE_DIR}
    ${STBIMAGE_INCLUDE_DIR}
    ${GLM_INCLUDE_DIR}
    ${TINYOBJLOADER_INCLUDE_DIR}
)

TARGET_LINK_LIBRARIES(
    vk_render
    ${VK_LIBRARY}
    ${GLFW3_LIBRARY}
)
